How Much Code is in a Megabyte?

There is this game I am making, actually its like an iPad, and I don’t want it to be laggy. I would like to know how much code is in a megabyte, if possible, and find how many megabytes Hopscotch can hold in one project.

I would think that around 50 blocks of code would be a megabyte, but I’m just guessing.

4 Likes

Try asking this question here:

I’m pretty sure that some Hopscotch JSON-interested people have that topic bookmarked or on watching so that they can see every new reply.

3 Likes

Thanks! By the way, what does JSON stand for?

3 Likes

It stands for JavaScript Object Notation.
You can read more about JSON here:
www.json.org.

2 Likes

A project size of 1 MB is actually very big.

3 Likes

How big it would be?

1 Like

json is just raw text read in a fancy way right?

2 Likes

Yup. It stands for JavaScript Object Notation, but you can use it with other languages as well.

2 Likes

yep
its really nice because you can also read it so if youre testing an api or something you actually see its response, not just alfiwhbv728ajds4jwjfh

1 Like

This topic can be closed

1 Like

Doesn’t look like the question was every really answered (but it’s a good question).

It takes about 300 characters (in the file that saves your project data) for the Hopscotch code block:

Set X to X + 1

I believe the encoding used is UTF8 so most characters would take 1 byte. So that block took 300 bytes. 1 MB is 1,000,000 bytes so it would take 1,000,000/300 = 3333 of those blocks to consume 1MB of file space.

Every block is different though. And there’s a lot of other data in the file as well, so you’d get less than 3333 blocks in a 1 MB file

How many MBs the file can be (it also gets gzipped for compression) depends on the current settings for the max size that’s allowed to be uploaded to the server. I haven’t tried a large file recently, but a while ago it was somewhere around 3MB, I believe. So that’s a lot of Hopscotch blocks…

2 Likes

I’d recommend this topic be left in Meta - Hopscotch when archived.

2 Likes

@ThinBuffalo topic not moved.