# General question on p5.js

**URL:** <https://discourse.processing.org/t/general-question-on-p5-js/33020>\
**Category:** Beginners\
**Created:** [October 23, 2021, 3:52pm UTC](https://discourse.processing.org/t/general-question-on-p5-js/33020 "2021-10-23T15:52:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user101](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/user101/32/15012_2.png) [@user101](https://discourse.processing.org/u/user101)\
**Post date:** [October 23, 2021, 3:52pm UTC](https://discourse.processing.org/t/general-question-on-p5-js/33020/1 "2021-10-23T15:52:17Z")

</div>

Hi!  
I wanna create my one website and therefore want to learn programming with p5.js. I have e question, however. The p5.js library files have together have a size of eight MB. Does this mean, these 8 MB have to downloaded from the server to the user when the website is called up by the user?

Thanks for any answers!

---

<div class="post-metadata">

**Author:** ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)\
**Post date:** [October 23, 2021, 5:19pm UTC](https://discourse.processing.org/t/general-question-on-p5-js/33020/2 "2021-10-23T17:19:24Z")

</div>

Hello, @user101, and welcome to the Processing Community!

See the page [p5.js: Get Started](https://p5js.org/get-started/).

Note this on the page:

> If you look in index.html, you’ll notice that it links to the file p5.js. If you would like to use the minified version (compressed for faster page loading), change the link to p5.min.js.
> 
> ```auto
> <script src="../p5.min.js"></script>
> 
> ```

That minified file is less than a megabyte in size. Adapt the link to the location from which you serve the file.

_EDIT (October 23, 2021):_

Depending upon the particulars of a given sketch that you host, the user might only need to be served the following:

- Your .html file
- Your .js sketch file
- Your .css file
- p5.min.js

In total, that might be less than a megabyte.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [October 23, 2021, 6:44pm UTC](https://discourse.processing.org/t/general-question-on-p5-js/33020/3 "2021-10-23T18:44:30Z")

</div>

Hi @user101,

Welcome to the forum! 😉

> [@user101](#):
>
> Does this mean, these 8 MB have to downloaded from the server to the user when the website is called up by the user?

About the average page weight of webpages today, here’s an interesting blog post about it:

> **[Page Weight | 2020 | The Web Almanac by HTTP Archive](https://almanac.httparchive.org/en/2020/page-weight)**
>
> Page Weight chapter of the 2020 Web Almanac covering why page weight matters, bandwidth, complex pages, page weight over time, page requests, and file formats.

On average it’s about 7MB and yes it needs to be transferred from the server to the client with HTTP. I don’t know if this number includes compression but most of the time it’s [compressed](https://en.wikipedia.org/wiki/HTTP_compression) by the server using gzip or Broti which reduces bandwidth usage 👍

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 23, 2021, 6:51pm UTC](https://discourse.processing.org/t/general-question-on-p5-js/33020/4 "2021-10-23T18:51:44Z")

</div>

> [@user101](#):
>
> , these 8 MB have to downloaded from the server to the user…

It doesn’t need to be from your own server. 😉  
You can grab libraries from a CDN server instead, like the example tag below: 🤫

`<script defer src=https://cdn.JsDelivr.net/npm/p5></script>`

[cdn.JsDelivr.net/npm/p5](http://cdn.JsDelivr.net/npm/p5)

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [October 23, 2021, 10:09pm UTC](https://discourse.processing.org/t/general-question-on-p5-js/33020/5 "2021-10-23T22:09:22Z")

</div>

Yes it is quite a big library for what it is but that’s the trade off with usability.

There are smaller alternatives, which may be interesting for you

> **[GitHub - LingDong-/q5xjs: A small and fast alternative (experimental)...](https://github.com/LingDong-/q5xjs)**
>
> A small and fast alternative (experimental) implementation of p5.js - GitHub - LingDong-/q5xjs: A small and fast alternative (experimental) implementation of p5.js
