A focused question and compact state saved 51 request-body bytes in our tests. The result is a size measurement, not proof of faster inference.
is-jodd’s request body is shorter than is-jeven 1.0.0’s body because it sends a compact state and a different question shape. Our capture of actual package calls found 51 fewer UTF-8 JSON bytes for every tested integer. This is a firsthand implementation result from is-jodd’s publisher, not a general TypeSafe optimization guarantee.
Compare the data the functions actually send
is-jeven wraps the input in a num property and asks a Choice question with two named options. is-jodd sends String(num) as its state and asks one Noul question without a Choice criteria map. The application still knows the expected response key and validates the returned type.
For input 3, the complete serialized request bodies were 159 bytes and 108 bytes respectively. That is a 32.1% reduction for that input. Longer integer representations increase both totals, so the same 51-byte difference becomes a smaller percentage.
You can measure a proposed body in Node without sending it:
const body = JSON.stringify({
model: 'jev-latest',
state: '37',
questions: {
odd: {
type: 'noul',
instructions: 'Is this integer odd?',
},
},
});
console.log(Buffer.byteLength(body, 'utf8'));
This measures the JSON string only. It does not measure headers, encryption overhead, network compression, or the provider’s internal work. Character count is also a different measure from UTF-8 byte count when text contains characters that require multiple bytes.
Preserve meaning before removing structure
A single integer has little surrounding context, so representing it as a string is easy to inspect. That observation does not justify flattening every application record. If a question depends on several fields, their labels may be necessary to distinguish which value means what.
A useful review asks whether removing a field changes the information available to the question. Keep an exact example before and after the change, then inspect how the receiving code finds and validates its answer. Saving a few bytes would be a poor trade if a future maintainer could no longer tell what was being evaluated.
Keep four measurements separate
Request size concerns transmitted JSON. Runtime-entry size concerns the shipped JavaScript file. Archive size includes metadata, documentation, and licensing. Latency concerns elapsed execution time. Each answers a different question.
Our runtime entry was 40.1% smaller, while the complete npm archive was 59.2% larger. Our live latency comparison did not establish a speed win. Read the full package comparison before repeating any percentage without its measurement label.
For reproducibility details, see the benchmark article. For ordinary arithmetic, the calculator avoids making a Jev request at all. is-jodd is an intentionally excessive demonstration with restrictive JODD-1T licensing, not an efficiency requirement for checking an integer.